package com.medistat.persistance.service.interfaces;

import java.util.Calendar;
import java.util.List;

import com.medistat.model.Doctor;
import com.medistat.model.FreeDay;
import com.medistat.model.StandardPersistentObject;
import com.medistat.model.WeekendDutiesInfo;
import com.medistat.model.Work;

public interface DaoService {
	//general queries
	<T extends StandardPersistentObject> void saveObject(T object);
	<T extends StandardPersistentObject> void saveOrUpdateAllObjects(List<T> objects);
	<T extends StandardPersistentObject> T getObject(Class<T> clazz, Long uid);
	<T extends StandardPersistentObject> void deleteObject(T entity);
	<T extends StandardPersistentObject> void updateObject(T  objectForUpdate);
	
	<T extends StandardPersistentObject> List<T> getAll(Class<T> clazz);
	<T extends StandardPersistentObject> void saveAll(List<T> objects);
	
	<T extends StandardPersistentObject> List<T> findObjectsByCriteria(Class<T> clazz, Parameter ...parameters);
	<T extends StandardPersistentObject> T findObjectByCriteria(Class<T> clazz, Parameter ...parameters);
	
	//custom queries
	List<Work> getDutiesForYear(Integer year);
	FreeDay findFreeDayForDoctorOn(Calendar date, Doctor doctor);
	WeekendDutiesInfo getWeekendDutiesInfoForMaxCreationDateAndDoctor(Doctor doctor);
	
}
